home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 0446 / clipstac.doc next >
Text File  |  1997-04-01  |  13KB  |  232 lines

  1. CLIPSTAC (Version 1.0)                    Copyright (c) 1992 PC Magazine
  2. ------------------------------------------------------------------------
  3. Richard Hale Shaw                                 August 1992 (Utilities
  4. ------------------------------------------------------------------------
  5.  
  6. CLIPSTAC:
  7.  
  8.      The Windows Clipboard over writes its entire contents the moment you
  9. copy a fresh piece of text or cut a second image to it. The Clipboard can
  10. hold one and only one item at a time; it is absolutely unforgiving.
  11. And, as you may have found, it takes just one accidentally lost cut to
  12. make you wish the Clipboard could accommodate multiple items.
  13.  
  14.       CLIPSTAC eliminates this dangerous limitation. CLIPSTAC creates a
  15. stack, or history list, of all the texts and bitmaps that any program cuts
  16. or copies to or from the Clipboard. It saves all these items in a file,
  17. CLIPSTAC.DAT, from which you can copy items back to the Clipboard by
  18. selecting the desired entry from a list box.
  19.  
  20.      Thus, anything you put onto the Clipboard can be retrieved and
  21. reused, day after day, from one Windows session to another. This not only
  22. safeguards your work, but makes the Clipboard a natural place to store
  23. and access frequently used logos, boilerplate texts, and the like.CLIPSTAC works equally well with both Windows 3.0 and 3.1.
  24.  
  25.       If you wish to recompile the utility you'll need a ~C++ compiler
  26. for Windows that supports templates. (I used Borland C++ 3.0; you can
  27. also use Microsoft C 7.0 or Zortech C++ 3.0.)
  28.  
  29. USING CLIPSTAC
  30.  
  31.      CLIPSTAC requires no special syntax or parameters. You can add it
  32. to a Program Group by choosing File, New from the Program Manager.
  33. Or you can choose File, Run and execute it from the command line simply
  34. by entering the following line:
  35.  
  36.                                 CLIPSTAC
  37.  
  38.      Probably the best way to take advantage of CLIPSTAC, however, is
  39. to set it up so that it loads whenever you run Windows. To do this, just
  40. check the AutoLoad item in the CLIPSTAC System Menu. This will put the
  41. full path of CLIPSTAC.EXE in the LOAD= entry of WIN.INI; each time
  42. you start Windows thereafter, CLIPSTAC will run as a minimized program.
  43. Alternatively, if you're using Windows 3.1, you can just add CLIPSTAC
  44. to your Startup group.
  45.  
  46.      To terminate CLIPSTAC, just select Close from its System Menu or
  47. double-click on the CLIPSTAC System icon.
  48.  
  49.      Once it's loaded, CLIPSTAC will open (or create) the CLIPSTAC.DAT
  50. file in your Windows directory.  If the Clipboard already has something
  51. on it, CLIPSTAC will automatically retrieve a copy. (You can always
  52. retrieve additional copies of items in the Clipboard using CLIPSTAC's
  53. Paste button.)  When you use CLIPSTAC to copy text or a bitmap to the
  54. Clipboard, CLIPSTAC will automatically make a copy and store it inCLIPSTAC.DAT.
  55.  
  56.      The CLIPSTAC interface consists of a single dialog box with a list
  57. box and several buttons. Whenever you copy a new item to the Clipboard,
  58. a new entry is added to the beginning of CLIPSTAC's list, which is
  59. displayed in the list box. Each entry displays the date and time that
  60. the item was retrieved from the Clipboard, the format (text, bitmap,
  61. and so on), the size of the item, and, when available, the name of the
  62. program that put the item onto the Clipboard. For text items, CLIPSTAC
  63. also displays the first 21 characters of text in its Contents field.
  64.  
  65.      A program can have more than one Clipboard format, or version of
  66. an item, in the Clipboard at a time.  Because CLIPSTAC always retrieves
  67. as many different item formats as are available, the same item will
  68. often appear (under different formats) more than once in CLIPSTAC's list.  This is particularly true with text items, for which two character
  69. sets are available.
  70.  
  71.      Typically, the program that puts an item onto the Clipboard is the
  72. Clipboard owner. But some programs (Notepad is one) do not access the
  73. Clipboard themselves; they use Windows' USER.DLL to accesss the Clipboard
  74. for them. In such a case the Clipboard owner will be the "User."
  75.  
  76.      You can select an item in CLIPSTAC's list by single-clicking on
  77. it with the mouse. (To select from the keyboard, Tab to the list and
  78. use the Arrow keys within the list.)  Pressing the Copy button when an
  79. item is selected (highlighted) will copy that item from CLIPSTAC's listback onto the Clipboard.  (Double-clicking on an item will accomplish
  80. the same thing.)  Note that when you copy an item from CLIPSTAC to the
  81. Clipboard, CLIPSTAC will sense the change in the Clipboard and recopy
  82. the item to the top of its list--just as it would if any other program
  83. had changed the Clipboard's contents.
  84.  
  85.      The Delete button removes a selected item from the list. The Paste
  86. button adds the item currently in the Clipboard to the top of CLIPSTAC's
  87. list. This is the same action that CLIPSTAC takes automatically when you
  88. change the Clipboard's contents. Paste, however, provides a convenient
  89. way to retrieve more than one copy of an item into CLIPSTAC's list
  90. without having to recopy it back onto the Clipboard from the program
  91. that put it there.
  92.  
  93. A QUICK TUTORIAL
  94.  
  95.      As all experienced Windows users probably know, you don't need to
  96. display the contents of Clipboard in order to make use of it. The
  97. Clipboard functions are available to applications whenever Windows is
  98. running. What you activate when you double-click on the Clipboard icon
  99. (or run CLIPBRD.EXE) is only the Clipboard Viewer. I suggest that you
  100. keep the Windows Clipboard Viewer open during your first experiments
  101. with CLIPSTAC so that you can monitor the Clipboard's contents at each
  102. step. You will also want to have CLIPSTAC open, of course, as well as
  103. a simple text editor (Notepad will do). It may take a little juggling
  104. to get them all on-screen at once, but the effort will be well spent.
  105.  
  106.      Start by opening a file or typing some text into the Notepad
  107. window and using the mouse to select it. (You can also select text in
  108. the window by holding down the Shift key while you move the cursor to
  109. the end of the desired text.) Then use Edit, Copy or, from the keyboard,
  110. Ctrl-C (Ctrl-Ins in Windows 3.0) to copy the highlighted text to the
  111. Clipboard. Alternatively, you can use Edit, Cut or Ctrl-X (Shift-Del
  112. in Windows 3.0) to cut the text from the editor to the Clipboard.
  113. As soon as you cut or copy text to the Clipboard, an entry representing
  114. that text will appear in CLIPSTAC's list box, as described previously.
  115. Now delete the text in the Clipboard and from the application so you
  116. know that it is only available from CLIPSTAC.
  117.  
  118.      To retrieve the text from CLIPSTAC back into your application,
  119. double-click on the text's entry in CLIPSTAC's list box. (Alternatively,
  120. you can single-click on the entry and press CLIPSTAC's Copy button.)
  121. This will put the item from CLIPSTAC back onto the Clipboard. Then return
  122. to the target application, position the cursor where you want the textto be inserted, and select Edit, Paste or Ctrl-V (Shift-Ins in
  123. Windows 3.0). Voila! The text will reappear in the target application's
  124. window.
  125.  
  126.      To copy a bitmap from an application into CLIPSTAC, you use a
  127. procedure similar to the one you use for text. For example, to copy a
  128. bitmap from Paintbrush into CLIPSTAC, open Paintbrush and select File,
  129. Open to open a bitmap file (such as 256COLOR.BMP). Select the icon in
  130. the upper-right corner (the one with the scissors and a square) and
  131. select a portion of the bitmap. (Click and hold the mouse button at one
  132. corner of the bitmap and drag the mouse to the other end of the bitmap,
  133. then release the mouse button.)
  134.  
  135.      Then use Edit, Copy (Ctrl-C or Ctrl-Ins) to copy the bitmap onto
  136. the Clipboard and so into CLIPSTAC. CLIPSTAC will display a new entry
  137. for the bitmap, though the Contents field will contain only dots. Clear
  138. the Clipboard once again to assure yourself that you're really making a
  139. copy from CLIPSTAC to the Clipboard in the next step.
  140.  
  141.      Now, to copy the bitmap from CLIPSTAC onto the Clipboard,
  142. double-click on the bitmap entry in CLIPSTAC's list (or single-click
  143. it and press the CLIPSTAC Copy button). Then paste the bitmap from the
  144. Clipboard back into Paintbrush by activating Paintbrush, positioning the
  145. cursor where you want the bitmap to go, and using Edit, Paste (Ctrl-V
  146. or Shift-Ins).
  147.  
  148.  MORE ON CLIPSTAC
  149.  
  150.      You'll notice when using CLIPSTAC that if you have more than ten
  151. entries in its list, you will not see new entries being added. The top
  152. of CLIPSTAC's list has simply scrolled off-screen. When this happens,
  153. a scroll bar will appear; you can use this to scroll through the list
  154. to the top of the stack. Whenever the top of the list is visible you'll
  155. see new items as they are added.
  156.  
  157.       CLIPSTAC limits the number of items you can store in its list.
  158. The default is 500, but you can set a lower limit by making an entry in
  159. WIN.INI, as described below. This may be wise, especially if you use it
  160. for bitmaps; CLIPSTAC.DAT can easily grow beyond several megabytes if
  161. you use it to store many different bitmaps.
  162.  
  163.      Items that you don't use again will eventually fall off the end of
  164. the list. That is to say, when you add the 501st item, the item at the
  165. bottom of the list will be discarded automatically. But whenever you use
  166. an item--that is, copy it from CLIPSTAC's list back onto the Clipboard--
  167. that item will also be copied to the beginning of the list. This safeguard
  168. will generally be enough to prevent a frequently used item from falling
  169. off the end of the list.
  170.  
  171.      Just to be sure, however, CLIPSTAC provides a ToTop button. When you
  172. press this button, the selected CLIPSTAC item is copied to the top of its
  173. list without being copied to the Clipboard, where it would overwrite the
  174. current Clipboard contents. (Of course, this will push every item in the
  175. list down one notch.)
  176.  
  177.      An additional CLIPSTAC feature helps deal with the disk-space
  178. problem that arises if you frequently use bitmaps. To appreciate the
  179. problem, press the Print Screen key while CLIPSTAC is running to copy a
  180. bitmap of the entire Windows desktop onto the Clipboard. (Depending on
  181. your computer, you may have to hit Print Screen twice, Shift-Print
  182. Screen, or Alt-Print Screen, as the Windows manual suggests.) CLIPSTAC's
  183. cursor will change to an hourglass while it copies the bitmap from the
  184. Clipboard into CLIPSTAC.DAT. When the bitmap entry appears in CLIPSTAC's
  185. list, you'll find that CLIPSTAC.DAT may be anywhere from 150K to a full
  186. megabyte, depending on your system's video resolution. All it takes is
  187. three or four of these and CLIPSTAC.DAT will balloon to several megabytes
  188. of valuable disk space.
  189.  
  190.      To prevent this, wherever possible CLIPSTAC duplicates the
  191. information about a list item without duplicating the item itself. Thus,
  192. you don't have to worry about CLIPSTAC.DAT's size exploding if you
  193. frequently use Copy or ToTop. You can prove this to yourself by hitting
  194. the Copy button several times when the desktop bitmap you just made is
  195. highlighted. Now use the File Manager (or DIR in a DOS window) to check
  196. the size of CLIPSTAC.DAT. It will have increased only by the size of the
  197. original bitmap, not by the size of the additional copies.
  198.  
  199.       You can control the number of items in CLIPSTAC's list in two ways.
  200. First, of course, you can use the Delete button to remove selected items
  201. from the list. As mentioned earlier, however, you can also reduce the
  202. default maximum number of items in the list by adding the MaxItems entry
  203. to the [ClipStac] section of WIN.INI. (CLIPSTAC will automatically create
  204. this section the first time you run it.)
  205.  
  206. Thus, you might enter
  207.  
  208.                        MaxItems=100
  209.  
  210. to limit the number of entries in CLIPSTAC's list to 100. Whenever the
  211. number of CLIPSTAC items exceeds 500 (or the MaxItems setting, whichever
  212. is smaller), CLIPSTAC will drop the item at the end of the list. The
  213. CLIPSTAC About box reports the current number of items in the list; just
  214. select About ClipStac from CLIPSTAC's System Menu.
  215.  
  216.      Whether a CLIPSTAC item falls off the end of the list or you use
  217. the Delete button to remove it, the item is not immediately removed from
  218. the CLIPSTAC.DAT file. As with many of the popular PC database programs,
  219. you must occasionally pack CLIPSTAC's data file to remove deleted items
  220. from the file and recover the disk space they occupied. When you press
  221. the Pack button, CLIPSTAC will write out a new copy of CLIPSTAC.DAT that
  222. contains only those items that are current in the list. And, wherever an
  223. item was created via the Copy or ToTop buttons, only a single copy of
  224. that item will remain in the entire data file.
  225.  
  226.      Note that, as with PC database programs, packing can take some time,
  227. especially if CLIPSTAC's list gets large or contains large items. If you
  228. find yourself using Pack during every CLIPSTAC session, you can check
  229. the AutoPack option in CLIPSTAC's System Menu. This will cause CLIPSTAC
  230. to pack CLIPSTAC.DAT automatically each time you start the program.
  231.  
  232. Richard Hale Shaw is a contributing editor to PC Magazine.«MDUL»«MDNM»